using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrmExtWeb.Core.Diagnostics;

public partial class ErrorPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string errorCode = Request.QueryString["errorcode"];
        if (!string.IsNullOrEmpty(errorCode))
        {
            ErrorMessage errorMessage = ErrorMessage.GetFromCode(errorCode);
            if (errorMessage != null)
            {
                if (!string.IsNullOrEmpty(errorMessage.Title))
                {
                    lblErrorTitle.Text = errorMessage.Title.Replace(Environment.NewLine, "<br>");
                }
                if (!string.IsNullOrEmpty(errorMessage.Message))
                {
                    lblErrorText.Text = errorMessage.Message.Replace(Environment.NewLine, "<br>");
                }
                if (errorMessage.Type != ErrorType.Unknown)
                {
                    string errorImage = "Images/err_" + errorMessage.Type.ToString().ToLower() + ".gif";
                    this.ImageErrorIcon.Src = errorImage;
                }
            }
        }
    }
}